package com.xymtop.api.implement;

import com.xymtop.api.entity.PStudent;
import com.xymtop.api.entity.PTeacher;
import com.xymtop.api.mapper.PStudentMapper;
import com.xymtop.api.mapper.PTeacherMapper;
import com.xymtop.api.service.PTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : PTeacherImpl
 * @Description : 教师信息实现类
 * @Author : 肖叶茂
 * @Date: 2022/12/1  16:43
 */
@Service
public class PTeacherImpl implements PTeacherService {
    @Autowired
    private PTeacherMapper pTeacherMapper;

    @Override
    public int add(PTeacher pTeacher) {
        return pTeacherMapper.add(pTeacher.getProjectid(),pTeacher.getName(),pTeacher.getJobtitle(),pTeacher.getInformation(),pTeacher.getRank());

    }

    @Override
    public int delete(String projectid, String userid) {
        return  pTeacherMapper.delete(projectid,userid);
    }

    @Override
    public int changeRank(String id, String userid, String rank) {
        return  pTeacherMapper.changeRank(id,userid,rank);
    }

    @Override
    public PTeacher get(String projectid, String name) {

        return pTeacherMapper.get(projectid, name);
    }

    @Override
    public List<PTeacher> getList(String projectid) {
        return pTeacherMapper.getList(projectid);
    }


}
